#!/bin/bash

#
# This script manipulates the amplifier gpio pins for Prj123
#

echo "Configuring Prj123 gains "
GN=0; 
if [ "$1" = "1" ]; then
    GN=1; 
fi
echo "G = " $GN


# 32*bbb_gpioN+bbb_gpioN_bitM

# GN = bbb_gpio0_31 = gpio31
if [ ! -d /sys/class/gpio/gpio31 ]; then  echo 31 > /sys/class/gpio/export; fi
#echo  out > /sys/class/gpio/gpio31/direction
echo  $GN > /sys/class/gpio/gpio31/value

# Show final values
echo "GN "
cat   /sys/class/gpio/gpio31/value
